﻿using System.ComponentModel;
using Aierp.Utility;
using Aierp.Utility.Data;

namespace Aierp.SystemEntities.System
{
    [TableName("Sys_V_Dics")]
    [Description("数据字典视图")]
    public class Sys_V_Dics
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Description("主键")]
        public int KeyId { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        public string Title { get; set; }
        /// <summary>
        /// 编码
        /// </summary>
        [Description("编码")]
        public string Code { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [Description("排序")]
        public int Sortnum { get; set; }

        /// <summary>
        /// 是否默认值 0 和 1
        /// </summary>
        [Description("是否默认值")]
        public int IsDefault { get; set; }

        [DbField(false)]
        public bool selected
        {
            get { return IsDefault == 1; }
        }
        public override string ToString()
        {
            return JSONhelper.ToJson(this);
        }
    }
}
